/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.mail.controller;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

/**
 *
 * @author DUYNGUYEN
 */
public class MailAutoController {

    public MailAutoController() {
        try {
            JobDetail job = new JobDetail();
            job.setName("dummyJobName");
            job.setJobClass(SchedulerJob.class);

            CronTrigger trigger = new CronTrigger();
            trigger.setName("dummyTriggerName");
            trigger.setCronExpression("0 0 7 ? * *");

            //schedule it
            Scheduler scheduler = new StdSchedulerFactory().getScheduler();
            scheduler.start();
            scheduler.scheduleJob(job, trigger);

        } catch (Exception e) {
            System.out.println("D:- Error from automail: " + e.getMessage());
        }
    }
}
